﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SubSectionInfoListEditWindow.ascx.cs" Inherits="ExaminationSys.View.Section.SubSectionInfoListEditWindow" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script type="text/javascript" language="javascript">
    var setID = function (id,paperId,sectionId) {
        try {

            var hidden = document.getElementById('<%=IDHidden.ClientID %>');
            hidden.value = id;

            var paperhidden = document.getElementById('<%=HidPaperId.ClientID %>');
            paperhidden.value = paperId;

            var sectionhidden = document.getElementById('<%=HidSectionId.ClientID %>');
            sectionhidden.value = sectionId;
        } catch (e) {
            alert(e);
        }
    };

    //编辑信息
    var win;
    function setInfo(pageurl) {
        var pageurl = "../Paper/SelectPaperList.aspx";
        win = new Ext.Window({
            title: '选择试卷',
            // maximizable : true,
            // maximized : true,
            width: 780,
            height: 520,
            // autoScroll : true,
            // bodyBorder : true,
            // draggable : true,
            isTopContainer: true,
            loadMask: {
                showMask: true,
                msg: "正在加载，请稍后……"
            },
            modal: true,
            resizable: false,
            contentEl: Ext.DomHelper.append(document.body, {
                tag: 'iframe',
                style: "border 0px none;scrollbar:false",
                src: pageurl,
                height: "100%",
                width: "100%"
            })
        });
        win.setPaperInfo = function (paperid, title) {

            var hidPaperId = document.getElementById('<%=HidPaperId.ClientID %>');
            hidPaperId.value = paperid;
            document.getElementById('ctl48_TB_Paper-inputEl').value = title;

        };
        win.show();

    }

</script>
    
<input type="hidden" id="IDHidden" runat="server" />
<input type="hidden" id="HidSectionId" runat="server" />
<input type="hidden" id="HidPaperId" runat="server" />
           <ext:Window 
            ID="EditNodeWindow" 
            runat="server" 
            Icon="Group" 
            Title="文章编辑"
            Height="510" 
            Width="750"
            AutoShow="false" 
            Modal="true" 
            Hidden="true"
            Layout="Fit"
            >
            <Items>
             <ext:FormPanel 
                    ID="NewsTypeEditPanel" 
                    runat="server" 
                    Icon="ChartOrganisation"
                    DefaultAnchor="95%"
                    Padding="5"
                    BodyPadding="10">
                    <Items>
                 <ext:Hidden ID="HiddenParentID" runat="server"></ext:Hidden>
                <ext:TextField ID="DetailForm_TB_Name" AllowBlank="false"  runat="server" FieldLabel="名称" />    
                <ext:SelectBox
                    ID="SelectBoxSubSectionType"
                    runat="server" 
                    FieldLabel="类型"
                    EmptyText="选择类型...">
                    <Items>
                        <ext:ListItem  Text="文章" Value="1" ></ext:ListItem>
                        <ext:ListItem  Text="测试" Value="2"></ext:ListItem>
                        <ext:ListItem  Text="练习" Value="3"></ext:ListItem>
                    </Items>
                </ext:SelectBox>
                <ext:TriggerField ID="TB_Paper"  runat="server" FieldLabel="试卷" DisableKeyFilter="true">
                    <Triggers>
                        <ext:FieldTrigger Icon="Search" HideTrigger="false"  />
                    </Triggers>
                    <Listeners>
                        <TriggerClick Fn="setInfo"></TriggerClick>
                    </Listeners>
                </ext:TriggerField>
                <ext:NumberField ID="NumberOrderIndex" AllowBlank="false" runat="server" FieldLabel="排序"   
                    MinValue="0"
                    MaxValue="20"/>

                 
                <ext:TextField ID="Knowledge" AllowBlank="false"  runat="server" FieldLabel="知识点(多个以；号隔开)" />  
                  <ext:HtmlEditor ID="TB_Content" FieldLabel="内容" runat="server" AutoScroll="true" Height="300" />            
        
                   </Items>
                </ext:FormPanel>
            </Items>
             <Buttons>
                <ext:Button ID="SaveNode" runat="server" Text="保存" Icon="Find">
                    <DirectEvents>
                        <Click OnEvent="SaveNode_Click"  Failure="Ext.MessageBox.alert('process failed', 'Error during ajax event');" Success="#{TreeStore}.load();" >
                        </Click>
                    </DirectEvents>
            
                </ext:Button>
                <ext:Button ID="CancelButton" runat="server" Text="取消" Icon="Cancel">
                    <Listeners>
                         <Click Handler="#{EditNodeWindow}.hide(null);" />
                    </Listeners>
                </ext:Button>
            </Buttons>
        </ext:Window>